package top.zsyle.org.eum;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;

@Getter
@AllArgsConstructor
public enum ShopStateEnum {

    WATE_AUDIT(0,"待审核"),
    WATE_ACTIVE(1,"待激活"),
    REJECTING(2,"驳回"),
    ACTIVING(3,"已激活");

    public static String getName(int code){
        ShopStateEnum stateEnum = Arrays.stream(ShopStateEnum.values()).filter(state -> code == state.getCode())
                .findFirst().orElse(null);
        return null == stateEnum? "":stateEnum.getName();
    }

    private Integer code;

    private String name;
}
